package com.heima.wemedia.feign;

import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmNewsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/api/v1/news")
public class WeNewsClient {
    @Autowired
    private WmNewsService wmNewsService;
    @PostMapping("list_vo")
    PageResponseResult findListByVo(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsService.findListVo(newsAuthDto);
    }
    @PostMapping("/auth_fail")
    ResponseResult authFail(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsService.authFail(newsAuthDto);
    }
   @PostMapping("/auth_pass")
    ResponseResult authPass(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsService.authPass(newsAuthDto);
    }
    @GetMapping("/one_vo/{id}")
    public  ResponseResult findOneById(@PathVariable Integer id){
        return wmNewsService.findOneById(id);
    }
}
